﻿#region Includes
using System;
using System.Runtime.InteropServices;
#endregion

namespace GingerGL.Graphics.Models.BSP
{
    //------------------------------------------------------------//
    /// <summary>
    /// node of BSP tree
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
    public struct BSPNode
    {
        //--------------------------------------------------------//
        #region Variables
        public Int32 PlaneIndex;
        public Int32 Front, Back;	//child nodes
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
        public Int32[] Mins;	//min x,y,z (bounding box)
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
        public Int32[] Maxs;
        static public readonly int SizeInBytes = sizeof(int) * 9;
        #endregion
        //--------------------------------------------------------//
    }
    //------------------------------------------------------------//
}
